package com.yc.navy.blog.blog.service.Impl;

import com.yc.navy.blog.blog.bean.TypeInfo;
import com.yc.navy.blog.blog.mapper.TypeInfoMapper;
import com.yc.navy.blog.blog.service.ITypeInfoService;
import com.yc.navy.blog.blog.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class TypeInfoServiceImpl implements ITypeInfoService {
@Autowired
private TypeInfoMapper typeInfoMapper;
    @Override
    public int add(String tname) {
        if (StringUtil.checknull(tname){
            return -100;
        }
        return typeInfoMapper.add(tname);
    }

    @Override
    public List<TypeInfo> list() {
        return typeInfoMapper.list();
    }
}
